package com.guns.dome1.utils;

/**
 * 加密工具，两层加密
 */
public class PasswordUtil {
    private final static String SALT = "Demo12345!@#$%67890";

    public static String twiceMd5BySalt(String inputText) {
        return EncryptUtil.md5(EncryptUtil.md5(inputText + SALT) + SALT);
    }

    public static boolean checkPassword(String dbPwd, String inputPwd) {
        if (dbPwd == null) {
            return false;
        }
        if (inputPwd == null) {
            return false;
        }
        return twiceMd5BySalt(inputPwd).equals(dbPwd);
    }
}
